﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GLYFrom
{
    public partial class YH_insert : Form
    {
        public YH_insert()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string Name = this.text_Name.Text.Trim();
            string Sex = this.comboBox1.Text.Trim();
            string ZhangHao = this.text_ZhangHao.Text.Trim();
            string MiMa = this.text_MiMa.Text.Trim();
            string DianHua = this.text_DianHua.Text.Trim();
            if (Name.Length>0 && Sex.Length>0 && ZhangHao.Length>0 && MiMa.Length>0 && DianHua.Length>0)
            {
                int sr = DBHelper.ZSG(string.Format("insert into T_YongHu values('{0}','{1}','{2}','{3}','{4}','{5}')", Name, Sex, ZhangHao, MiMa, DianHua,0));
                if (sr > 0)
                {
                    MessageBox.Show("添加成功！");
                }
                else
                {
                    MessageBox.Show("添加失败！");
                }
            }
            else
            {
                MessageBox.Show("添加失败,请填写完整！");
                return;
            }
           
        }

        private void YH_insert_Load(object sender, EventArgs e)
        {

        }
    }
}
